﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FreeSql;
using FreeSql.Extensions;

namespace KongMing.ORM.FreeSqlDemo
{
    internal static class FreeSqlHelper
    {
        public static IFreeSql GetFreeSql(DataType dataType, string connectionString)
        {
            IFreeSql fsql = new FreeSql.FreeSqlBuilder()
                .UseMonitorCommand(x => Console.WriteLine(x.CommandText))
                .UseConnectionString(dataType, connectionString)
                .Build();
            fsql.UseJsonMap();
            return fsql;
        }
    }
}
